package com.payment.ktb.constants;

/**
 * Created by admin on 2017/12/4.
 */

public enum ConstantsOrderManage {

    INIT(10, "初始化"),//
    WAIT(11, "等待支付"),//
    CONF(12, "订单确认"),//
    PAYING(13, "支付中"),//
    SUCC(20, "支付成功"),//
    FAIL(21, "支付失败"),//
    FRZE(30, "订单风控"),//
    HOLD(99, "订单保留");

    private int code;
    private String name;

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    ConstantsOrderManage(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getStatus(int code) {

        for (ConstantsOrderManage constantsCustomer: ConstantsOrderManage.values()) {
            if (code == constantsCustomer.getCode()) {
                return constantsCustomer.getName();
            }
        }
        return "未知";
    }


}
